/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Casting;

import java.awt.Point;

/**
 *
 * @author Dennis
 */
public class ProbarReferencia {
    public static void main(String[] args) {
        
        Point pt1,pt2;
        pt1= new Point(100,100);
        //pt2 = new Point(100,100);
        //crea referencia, cualquier cambio en pt1 se reflejara en pt2
        pt2 = pt1;
        
        
        pt1.x = 200;
        pt1.y = 200;
        
        System.out.println("Point1: "+pt1.x+", "+pt1.y);
        System.out.println("Point2: "+pt2.x+", "+pt2.y);
        
    }
}
